set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -lpthread -fPIC ")

include_directories(${PROJECT_SOURCE_DIR}/include)

LINK_DIRECTORIES(${PROJECT_SOURCE_DIR}/lib)

set (SRCS
    ${PROJECT_SOURCE_DIR}/include/pugixml/pugixml.cpp
    logcplus_fileutil.cpp
    logcplus_lockutil.cpp
    logcplus_string.cpp
    logcplus_util.cpp
    logcplus_common.cpp
    logcplus_layout.cpp
    logcplus_properties.cpp
    logcplus_buffer.cpp   
    logcplus_debug_util.cpp
    logcplus_log_clean.cpp
    logcplus_lock.cpp
    logcplus_base_writer.cpp 
    logcplus_writer_console.cpp
    logcplus_writer_syslog.cpp
    logcplus_writer_file.cpp
    logcplus_writer_remote_udp.cpp
    logcplus_factory.cpp
    logcplus_logger.cpp
    logcplus_easylog.cpp
    )

##set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib)

add_library(logcplus SHARED ${SRCS})
install(TARGETS logcplus DESTINATION ${LIBRARY_INSTALL_PATH})

set (HEADERS
    logcplus_fileutil.h
    logcplus_lockutil.h
    logcplus_easylog.h
    logcplus_version.h
    logcplus_types.h
    logcplus_string.hpp
    logcplus_util.h
    logcplus_common.h
    logcplus_layout.h
    logcplus_properties.h
    logcplus_buffer.h   
    logcplus_debug_util.h
    logcplus_log_clean.h
    logcplus_lock.h
    logcplus_base_writer.h 
    logcplus_writer_console.h
    logcplus_writer_syslog.h
    logcplus_writer_file.h
    logcplus_writer_remote_udp.h
    logcplus_factory.h
    logcplus_logger.h
    logcplus.h
    )

install(FILES ${HEADERS} DESTINATION ${INCLUDE_INSTALL_PATH}/logcplus)
